package panda.record;

/**
 * The complete information about the position of a certain
 * tuple
 * 
 * @author Tian Yuan
 */
public class TupleToken {
	private int blk, offset;
	
	public TupleToken(int blk, int offset) {
		this.blk = blk;
		this.offset = offset;
	}
	
	/**
	 * Get the block number where the tuple lies
	 * @return the block number
	 */
	public int getBlockNum() {
		return blk;
	}
	
	/**
	 * Get the position of the tuple in the block
	 * @return the offset of the tuple
	 */
	public int getOffSet() {
		return offset;
	}
	
	/**
	 * Judge whether two tokens refer to the same tuple
	 * @param tt the other tuple
	 * @return
	 */
	public boolean equals(TupleToken tt) {
		return tt.blk == this.blk && tt.offset == this.offset;
	}
	
}
